package com.vaadinproject;

import com.vaadin.Application;
import com.vaadin.ui.*;
import com.vaadin.ui.LoginForm.LoginEvent;

@SuppressWarnings("serial")
public class VaadinProjectApplication extends Application {
	@Override
	public void init() {
		Window mainWindow = new Window("VaadinProjectApplication");
		final Label label = new Label();
		label.setCaption("Hello Vaadin user. Please, log in.");
		LoginForm loginForm = new LoginForm();
		loginForm.addListener(new LoginForm.LoginListener() {
			@Override
			public void onLogin(LoginEvent event) {
				label.setCaption("Login successful.");
			}
		});
		mainWindow.addComponent(label);
		mainWindow.addComponent(loginForm);
		setMainWindow(mainWindow);
		setTheme("runo");
	}

}
